package cn.com.qtgl.tests.model.entity;

import cn.melonlib.cores.commons.model.entity.TenantRecordEntity;
import cn.melonlib.cores.model.anno.ModelComment;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import cn.com.qtgl.tests.model.enums.Gender;

@Entity(name = "User")
@Data
@EqualsAndHashCode(callSuper = true)
@Table(name = "sys_user")
@ModelComment("用户信息")
public class User extends TenantRecordEntity {

    @ModelComment(value = "用户编号",required = true)
    private String code;

    @ModelComment(value = "用户姓名",required = true)
    private String name;

    @ModelComment("用户性别")
    @Enumerated(EnumType.STRING)
    private Gender gender= Gender.MAN;

    @ModelComment("手机号码")
    private String mobile;

    @ModelComment("电子邮箱")
    private String email;

    @ModelComment("头像")
    private String avatar;

    @ModelComment("联系地址")
    @Column(length = 1000)
    private String address;

    @ModelComment("备注")
    @Lob
    @Basic(fetch = FetchType.LAZY)
    private String memo;

    @ModelComment("状态")
    private Boolean status;

    @ModelComment("评分")
    private Double score;

    @ModelComment("权限")
    private Integer permissions;
}
